<template>
  <CommonTablePage
    :tableInfo="tableInfo"
    :insertTableInfo="insertTableInfo"
    :tableReqUrl="tableReqUrl"
    @onGetDeleteReqUrl="getDeleteReqUrl"
  />
</template>

<script lang="ts" setup>
import {ref, reactive, onBeforeMount, provide} from "vue";
import CommonTablePage from "@/components/common/CommonTablePage.vue";

const tableReqUrl = ref("/api/admin")

const tableInfo = ref([
  {prop: "adminId", label: "工号"},
  {prop: "adminName", label: "姓名"},
  {prop: "adminPhone", label: "联系电话"},
  {prop: "adminUsername", label: "账号"},
]);

const insertTableInfo = ref([
  {prop: "adminName", label: "姓名"},
  {prop: "adminPhone", label: "联系电话"},
  {prop: "adminUsername", label: "账号"},
  {prop: "adminPassword", label: "密码", isPassword: true},
]);

// 删除请求url
const getDeleteReqUrl = async ({value,reFun}) => {
  reFun(`${tableReqUrl.value}/${value.adminId}`);
};


</script>

<style scoped>

</style>